<?php if(Yii::app()->user->isGuest):?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'login-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
)); ?>

<!-- 	<p class="note">Fields with <span class="required">*</span> are required.</p> -->

	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username'); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password'); ?>
		<?php echo $form->error($model,'password'); ?>
<!-- 		<p class="hint">
			Hint: You may login with <tt>demo/demo</tt> or <tt>admin/admin</tt>.
		</p>
 -->
	</div>

	<div class="row rememberMe clearfix ">
		<?php echo $form->checkBox($model,'rememberMe'); ?>
		<?php echo $form->label($model,'rememberMe'); ?>
		<?php echo $form->error($model,'rememberMe'); ?>
	</div>
	
	<hr class="clearfix"  />

	<div class="row buttons clearfix ">
		<?php// echo CHtml::submitButton('登录',array('clsss'=>'red')); ?>
		<input type="submit" value="Submit Form " class="red" />
	</div>
	
		<hr class="clearfix"  />
		
		<div class="row">
		<?php $this->widget('ext.oauthLogin.OauthLogin',array(
		           'itemView'=>'medium_login', //效果样式
		           'back_url'=>Yii::app()->homeUrl,//login成功后返回的页面
		 )); ?>		
		</div>
	

	
	<hr class="clearfix"  />
<?php $this->endWidget(); ?>
</div><!-- form -->
<?php else:?>
    <div class="form" style="background: white;">
    	<div class="row">
    		欢迎使用本系统，<?php echo Yii::app()->user->name;?>
    	</div>
    	<div class="row">
    		进入<a href="<?php echo Yii::app()->createUrl('/admin');?>">控制面板</a>
    	</div>
    	<div class="row">
    		<a href="<?php echo Yii::app()->createUrl('site/logout');?>">注销</a>
    	</div>    
    </div>

<?php endif;?>